 
{% extends 'base.html' %}

{% block content %}
<div class="results-container">
    <h2>"{{ query }}"的搜索结果</h2>
    
    {% for result in results %}
    <div class="result-item">
        <h3><a target="_blank" href="{{ result['url'] }}">{{ result['title'] }}</a></h3>
        <p class="url">{{ result['url'] }}</p>
        <p class="snippet">{{ result['content'][:200] }}...</p>
    </div>
    {% endfor %}
    
    <div class="pagination">
        {% if page > 1 %}
            <a href="{{ url_for('search', q=query, page=page-1) }}">上一页</a>
        {% endif %}
        <span>页数 {{ page }}</span>
        {% if results|length == 10 %}
            <a href="{{ url_for('search', q=query, page=page+1) }}">下一页</a>
        {% endif %}
    </div>
</div>
{% endblock %}
 